import React, { Component } from 'react'
import {Route,Redirect,Switch} from 'react-router-dom'

import MyNavLink from '../../component/MyNavLink'
import News from './News'
import Message from './Message'


export default class Home extends Component {
  render() {
    return (
      <div>
        <h3>我是Home的内容</h3>
        <MyNavLink to="/home/news">news</MyNavLink>
        <MyNavLink to="/home/message">message</MyNavLink>
        <Switch>
          <Route path="/home/news" component={News} />
          <Route  path="/home/message" component={Message} />
          <Redirect to="/home/message" ></Redirect>
        </Switch>
      </div>
    )
  }
}
